.class public Lorg/microemu/android/device/AndroidDisplayGraphics;
.super Ljavax/microedition/lcdui/Graphics;
.source "AndroidDisplayGraphics.java"


# instance fields
.field private canvas:Landroid/graphics/Canvas;

.field private clip:Landroid/graphics/Rect;

.field private font:Ljavax/microedition/lcdui/Font;

.field private paint:Landroid/graphics/Paint;


# direct methods
.method public constructor <init>(Landroid/graphics/Canvas;)V
    .locals 2
    .parameter "canvas"

    .prologue
    .line 52
    invoke-direct {p0}, Ljavax/microedition/lcdui/Graphics;-><init>()V

    .line 46
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    .line 53
    iput-object p1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    .line 54
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Landroid/graphics/Canvas;->save(I)I

    .line 55
    invoke-virtual {p1}, Landroid/graphics/Canvas;->getClipBounds()Landroid/graphics/Rect;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    .line 56
    invoke-static {}, Ljavax/microedition/lcdui/Font;->getDefaultFont()Ljavax/microedition/lcdui/Font;

    move-result-object v0

    invoke-virtual {p0, v0}, Lorg/microemu/android/device/AndroidDisplayGraphics;->setFont(Ljavax/microedition/lcdui/Font;)V

    .line 57
    return-void
.end method


# virtual methods
.method public clipRect(IIII)V
    .locals 3
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 60
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    add-int v1, p1, p3

    add-int v2, p2, p4

    invoke-virtual {v0, p1, p2, v1, v2}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 61
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    invoke-virtual {v0}, Landroid/graphics/Canvas;->getClipBounds()Landroid/graphics/Rect;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    .line 62
    return-void
.end method

.method public copyArea(IIIIIII)V
    .locals 1
    .parameter "x_src"
    .parameter "y_src"
    .parameter "width"
    .parameter "height"
    .parameter "x_dest"
    .parameter "y_dest"
    .parameter "anchor"

    .prologue
    .line 364
    const-string v0, "copyArea"

    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;)V

    .line 365
    return-void
.end method

.method public drawArc(IIIIII)V
    .locals 6
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "startAngle"
    .parameter "arcAngle"

    .prologue
    .line 65
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 66
    new-instance v1, Landroid/graphics/RectF;

    int-to-float v0, p1

    int-to-float v2, p2

    add-int v3, p1, p3

    int-to-float v3, v3

    add-int v4, p2, p4

    int-to-float v4, v4

    invoke-direct {v1, v0, v2, v3, v4}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 67
    .local v1, rect:Landroid/graphics/RectF;
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v2, p5

    int-to-float v3, p6

    const/4 v4, 0x0

    iget-object v5, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawArc(Landroid/graphics/RectF;FFZLandroid/graphics/Paint;)V

    .line 68
    return-void
.end method

.method public drawImage(Ljavax/microedition/lcdui/Image;III)V
    .locals 7
    .parameter "img"
    .parameter "x"
    .parameter "y"
    .parameter "anchor"

    .prologue
    .line 71
    move v0, p2

    .line 72
    .local v0, newx:I
    move v1, p3

    .line 74
    .local v1, newy:I
    if-nez p4, :cond_0

    .line 75
    const/16 p4, 0x14

    .line 78
    :cond_0
    and-int/lit8 v2, p4, 0x8

    if-eqz v2, :cond_3

    .line 79
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    sub-int/2addr v0, v2

    .line 83
    :cond_1
    :goto_0
    and-int/lit8 v2, p4, 0x20

    if-eqz v2, :cond_4

    .line 84
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v2

    sub-int/2addr v1, v2

    .line 89
    :cond_2
    :goto_1
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->isMutable()Z

    move-result v2

    if-eqz v2, :cond_5

    .line 90
    iget-object v2, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    check-cast p1, Lorg/microemu/android/device/AndroidMutableImage;

    .end local p1
    invoke-virtual {p1}, Lorg/microemu/android/device/AndroidMutableImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v3

    int-to-float v4, v0

    int-to-float v5, v1

    iget-object v6, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 94
    :goto_2
    return-void

    .line 80
    .restart local p1
    :cond_3
    and-int/lit8 v2, p4, 0x1

    if-eqz v2, :cond_1

    .line 81
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    div-int/lit8 v2, v2, 0x2

    sub-int/2addr v0, v2

    goto :goto_0

    .line 85
    :cond_4
    and-int/lit8 v2, p4, 0x2

    if-eqz v2, :cond_2

    .line 86
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v2

    div-int/lit8 v2, v2, 0x2

    sub-int/2addr v1, v2

    goto :goto_1

    .line 92
    :cond_5
    iget-object v2, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    check-cast p1, Lorg/microemu/android/device/AndroidImmutableImage;

    .end local p1
    invoke-virtual {p1}, Lorg/microemu/android/device/AndroidImmutableImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v3

    int-to-float v4, v0

    int-to-float v5, v1

    iget-object v6, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    goto :goto_2
.end method

.method public drawLine(IIII)V
    .locals 6
    .parameter "x1"
    .parameter "y1"
    .parameter "x2"
    .parameter "y2"

    .prologue
    .line 97
    if-le p1, p3, :cond_0

    .line 98
    add-int/lit8 p1, p1, 0x1

    .line 102
    :goto_0
    if-le p2, p4, :cond_1

    .line 103
    add-int/lit8 p2, p2, 0x1

    .line 108
    :goto_1
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v1, p1

    int-to-float v2, p2

    int-to-float v3, p3

    int-to-float v4, p4

    iget-object v5, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    .line 109
    return-void

    .line 100
    :cond_0
    add-int/lit8 p3, p3, 0x1

    goto :goto_0

    .line 105
    :cond_1
    add-int/lit8 p4, p4, 0x1

    goto :goto_1
.end method

.method public drawRGB([IIIIIIIZ)V
    .locals 11
    .parameter "rgbData"
    .parameter "offset"
    .parameter "scanlength"
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "processAlpha"

    .prologue
    .line 342
    if-nez p1, :cond_0

    .line 343
    new-instance v0, Ljava/lang/NullPointerException;

    invoke-direct {v0}, Ljava/lang/NullPointerException;-><init>()V

    throw v0

    .line 345
    :cond_0
    if-eqz p6, :cond_1

    if-nez p7, :cond_2

    .line 356
    :cond_1
    :goto_0
    return-void

    .line 349
    :cond_2
    array-length v10, p1

    .line 350
    .local v10, l:I
    if-ltz p6, :cond_4

    if-ltz p7, :cond_4

    if-ltz p2, :cond_4

    if-ge p2, v10, :cond_4

    if-gez p3, :cond_3

    const/4 v0, 0x1

    sub-int v0, p7, v0

    mul-int/2addr v0, p3

    if-ltz v0, :cond_4

    :cond_3
    if-ltz p3, :cond_5

    const/4 v0, 0x1

    sub-int v0, p7, v0

    mul-int/2addr v0, p3

    add-int v0, v0, p6

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    if-lt v0, v10, :cond_5

    .line 352
    :cond_4
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 355
    :cond_5
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    iget-object v9, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move/from16 v5, p5

    move/from16 v6, p6

    move/from16 v7, p7

    move/from16 v8, p8

    invoke-virtual/range {v0 .. v9}, Landroid/graphics/Canvas;->drawBitmap([IIIIIIIZLandroid/graphics/Paint;)V

    goto :goto_0
.end method

.method public drawRect(IIII)V
    .locals 6
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 112
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 113
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v1, p1

    int-to-float v2, p2

    add-int v3, p1, p3

    int-to-float v3, v3

    add-int v4, p2, p4

    int-to-float v4, v4

    iget-object v5, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    .line 114
    return-void
.end method

.method public drawRegion(Ljavax/microedition/lcdui/Image;IIIIIIII)V
    .locals 17
    .parameter "src"
    .parameter "x_src"
    .parameter "y_src"
    .parameter "width"
    .parameter "height"
    .parameter "transform"
    .parameter "x_dst"
    .parameter "y_dst"
    .parameter "anchor"

    .prologue
    .line 219
    add-int v6, p2, p4

    invoke-virtual/range {p1 .. p1}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v7

    if-gt v6, v7, :cond_0

    add-int v6, p3, p5

    invoke-virtual/range {p1 .. p1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v7

    if-gt v6, v7, :cond_0

    if-ltz p4, :cond_0

    if-ltz p5, :cond_0

    if-ltz p2, :cond_0

    if-gez p3, :cond_1

    .line 221
    :cond_0
    new-instance v6, Ljava/lang/IllegalArgumentException;

    const-string v7, "Area out of Image"

    invoke-direct {v6, v7}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 227
    :cond_1
    invoke-virtual/range {p1 .. p1}, Ljavax/microedition/lcdui/Image;->isMutable()Z

    move-result v6

    if-eqz v6, :cond_2

    invoke-virtual/range {p1 .. p1}, Ljavax/microedition/lcdui/Image;->getGraphics()Ljavax/microedition/lcdui/Graphics;

    move-result-object v6

    move-object v0, v6

    move-object/from16 v1, p0

    if-ne v0, v1, :cond_2

    .line 228
    new-instance v6, Ljava/lang/IllegalArgumentException;

    const-string v7, "Image is source and target"

    invoke-direct {v6, v7}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 232
    :cond_2
    invoke-virtual/range {p1 .. p1}, Ljavax/microedition/lcdui/Image;->isMutable()Z

    move-result v6

    if-eqz v6, :cond_3

    .line 233
    check-cast p1, Lorg/microemu/android/device/AndroidMutableImage;

    .end local p1
    invoke-virtual/range {p1 .. p1}, Lorg/microemu/android/device/AndroidMutableImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v5

    .line 238
    .local v5, img:Landroid/graphics/Bitmap;
    :goto_0
    new-instance v10, Landroid/graphics/Matrix;

    invoke-direct {v10}, Landroid/graphics/Matrix;-><init>()V

    .line 239
    .local v10, matrix:Landroid/graphics/Matrix;
    move/from16 v14, p4

    .local v14, dW:I
    move/from16 v13, p5

    .line 240
    .local v13, dH:I
    packed-switch p6, :pswitch_data_0

    .line 284
    new-instance v6, Ljava/lang/IllegalArgumentException;

    const-string v7, "Bad transform"

    invoke-direct {v6, v7}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 235
    .end local v5           #img:Landroid/graphics/Bitmap;
    .end local v10           #matrix:Landroid/graphics/Matrix;
    .end local v14           #dW:I
    .end local v13           #dH:I
    .restart local p1
    :cond_3
    check-cast p1, Lorg/microemu/android/device/AndroidImmutableImage;

    .end local p1
    invoke-virtual/range {p1 .. p1}, Lorg/microemu/android/device/AndroidImmutableImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v5

    .restart local v5       #img:Landroid/graphics/Bitmap;
    goto :goto_0

    .line 245
    .restart local v10       #matrix:Landroid/graphics/Matrix;
    .restart local v13       #dH:I
    .restart local v14       #dW:I
    :pswitch_0
    const/high16 v6, 0x42b4

    invoke-virtual {v10, v6}, Landroid/graphics/Matrix;->preRotate(F)Z

    .line 246
    const/4 v11, 0x1

    move/from16 v6, p2

    move/from16 v7, p3

    move/from16 v8, p4

    move/from16 v9, p5

    invoke-static/range {v5 .. v11}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 247
    .restart local v5       #img:Landroid/graphics/Bitmap;
    move/from16 v14, p5

    .line 248
    move/from16 v13, p4

    .line 289
    :goto_1
    :pswitch_1
    const/4 v12, 0x0

    .line 291
    .local v12, badAnchor:Z
    if-nez p9, :cond_4

    .line 292
    const/16 p9, 0x14

    .line 295
    :cond_4
    and-int/lit8 v6, p9, 0x7f

    move v0, v6

    move/from16 v1, p9

    if-ne v0, v1, :cond_5

    and-int/lit8 v6, p9, 0x40

    if-eqz v6, :cond_6

    .line 296
    :cond_5
    const/4 v12, 0x1

    .line 298
    :cond_6
    and-int/lit8 v6, p9, 0x10

    if-eqz v6, :cond_9

    .line 299
    and-int/lit8 v6, p9, 0x22

    if-eqz v6, :cond_7

    .line 300
    const/4 v12, 0x1

    .line 315
    :cond_7
    :goto_2
    and-int/lit8 v6, p9, 0x4

    if-eqz v6, :cond_d

    .line 316
    and-int/lit8 v6, p9, 0x9

    if-eqz v6, :cond_8

    .line 317
    const/4 v12, 0x1

    .line 331
    :cond_8
    :goto_3
    if-eqz v12, :cond_11

    .line 332
    new-instance v6, Ljava/lang/IllegalArgumentException;

    const-string v7, "Bad Anchor"

    invoke-direct {v6, v7}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 252
    .end local v12           #badAnchor:Z
    :pswitch_2
    const/high16 v6, 0x4334

    invoke-virtual {v10, v6}, Landroid/graphics/Matrix;->preRotate(F)Z

    .line 253
    const/4 v11, 0x1

    move/from16 v6, p2

    move/from16 v7, p3

    move/from16 v8, p4

    move/from16 v9, p5

    invoke-static/range {v5 .. v11}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 254
    .restart local v5       #img:Landroid/graphics/Bitmap;
    goto :goto_1

    .line 257
    :pswitch_3
    const/high16 v6, 0x4387

    invoke-virtual {v10, v6}, Landroid/graphics/Matrix;->preRotate(F)Z

    .line 258
    const/4 v11, 0x1

    move/from16 v6, p2

    move/from16 v7, p3

    move/from16 v8, p4

    move/from16 v9, p5

    invoke-static/range {v5 .. v11}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 259
    .restart local v5       #img:Landroid/graphics/Bitmap;
    move/from16 v14, p5

    .line 260
    move/from16 v13, p4

    .line 261
    goto :goto_1

    .line 269
    :pswitch_4
    move/from16 v14, p5

    .line 270
    move/from16 v13, p4

    .line 271
    goto :goto_1

    .line 279
    :pswitch_5
    move/from16 v14, p5

    .line 280
    move/from16 v13, p4

    .line 281
    goto :goto_1

    .line 301
    .restart local v12       #badAnchor:Z
    :cond_9
    and-int/lit8 v6, p9, 0x20

    if-eqz v6, :cond_b

    .line 302
    and-int/lit8 v6, p9, 0x2

    if-eqz v6, :cond_a

    .line 303
    const/4 v12, 0x1

    goto :goto_2

    .line 305
    :cond_a
    const/4 v6, 0x1

    sub-int v6, v13, v6

    sub-int p8, p8, v6

    goto :goto_2

    .line 307
    :cond_b
    and-int/lit8 v6, p9, 0x2

    if-eqz v6, :cond_c

    .line 308
    const/4 v6, 0x1

    sub-int v6, v13, v6

    ushr-int/lit8 v6, v6, 0x1

    sub-int p8, p8, v6

    goto :goto_2

    .line 311
    :cond_c
    const/4 v12, 0x1

    goto :goto_2

    .line 318
    :cond_d
    and-int/lit8 v6, p9, 0x8

    if-eqz v6, :cond_f

    .line 319
    and-int/lit8 v6, p9, 0x1

    if-eqz v6, :cond_e

    .line 320
    const/4 v12, 0x1

    goto :goto_3

    .line 322
    :cond_e
    const/4 v6, 0x1

    sub-int v6, v14, v6

    sub-int p7, p7, v6

    goto :goto_3

    .line 324
    :cond_f
    and-int/lit8 v6, p9, 0x1

    if-eqz v6, :cond_10

    .line 325
    const/4 v6, 0x1

    sub-int v6, v14, v6

    ushr-int/lit8 v6, v6, 0x1

    sub-int p7, p7, v6

    goto :goto_3

    .line 328
    :cond_10
    const/4 v12, 0x1

    goto :goto_3

    .line 335
    :cond_11
    new-instance v16, Landroid/graphics/Rect;

    add-int v6, p2, p4

    add-int v7, p3, p5

    move-object/from16 v0, v16

    move/from16 v1, p2

    move/from16 v2, p3

    move v3, v6

    move v4, v7

    invoke-direct {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 336
    .local v16, srcRect:Landroid/graphics/Rect;
    new-instance v15, Landroid/graphics/Rect;

    add-int v6, p7, p4

    add-int v7, p8, p5

    move-object v0, v15

    move/from16 v1, p7

    move/from16 v2, p8

    move v3, v6

    move v4, v7

    invoke-direct {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 337
    .local v15, dstRect:Landroid/graphics/Rect;
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    move-object v6, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    move-object v7, v0

    move-object v0, v6

    move-object v1, v5

    move-object/from16 v2, v16

    move-object v3, v15

    move-object v4, v7

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 338
    return-void

    .line 240
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_1
        :pswitch_1
        :pswitch_2
        :pswitch_5
        :pswitch_0
        :pswitch_3
        :pswitch_4
    .end packed-switch
.end method

.method public drawRoundRect(IIIIII)V
    .locals 1
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "arcWidth"
    .parameter "arcHeight"

    .prologue
    .line 117
    const-string v0, "drawRoundRect"

    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;)V

    .line 118
    return-void
.end method

.method public drawString(Ljava/lang/String;III)V
    .locals 7
    .parameter "str"
    .parameter "x"
    .parameter "y"
    .parameter "anchor"

    .prologue
    .line 121
    move v1, p2

    .line 122
    .local v1, newx:I
    move v2, p3

    .line 124
    .local v2, newy:I
    if-nez p4, :cond_0

    .line 125
    const/16 p4, 0x14

    .line 128
    :cond_0
    iget-object v3, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->font:Ljavax/microedition/lcdui/Font;

    invoke-static {v3}, Lorg/microemu/android/device/AndroidFontManager;->getFont(Ljavax/microedition/lcdui/Font;)Lorg/microemu/android/device/AndroidFont;

    move-result-object v0

    .line 130
    .local v0, androidFont:Lorg/microemu/android/device/AndroidFont;
    and-int/lit8 v3, p4, 0x10

    if-eqz v3, :cond_3

    .line 131
    iget-object v3, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    invoke-virtual {v3}, Landroid/graphics/Paint;->getFontMetricsInt()Landroid/graphics/Paint$FontMetricsInt;

    move-result-object v3

    iget v3, v3, Landroid/graphics/Paint$FontMetricsInt;->ascent:I

    sub-int/2addr v2, v3

    .line 135
    :cond_1
    :goto_0
    and-int/lit8 v3, p4, 0x1

    if-eqz v3, :cond_4

    .line 136
    int-to-float v3, v1

    iget-object v4, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    invoke-virtual {v4, p1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v4

    const/high16 v5, 0x4000

    div-float/2addr v4, v5

    sub-float/2addr v3, v4

    float-to-int v1, v3

    .line 141
    :cond_2
    :goto_1
    iget-object v3, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    iget-object v4, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual {v4}, Landroid/graphics/Paint;->getColor()I

    move-result v4

    invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V

    .line 142
    iget-object v3, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v4, v1

    int-to-float v5, v2

    iget-object v6, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    invoke-virtual {v3, p1, v4, v5, v6}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 143
    return-void

    .line 132
    :cond_3
    and-int/lit8 v3, p4, 0x20

    if-eqz v3, :cond_1

    .line 133
    iget-object v3, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    invoke-virtual {v3}, Landroid/graphics/Paint;->getFontMetricsInt()Landroid/graphics/Paint$FontMetricsInt;

    move-result-object v3

    iget v3, v3, Landroid/graphics/Paint$FontMetricsInt;->descent:I

    sub-int/2addr v2, v3

    goto :goto_0

    .line 137
    :cond_4
    and-int/lit8 v3, p4, 0x8

    if-eqz v3, :cond_2

    .line 138
    int-to-float v3, v1

    iget-object v4, v0, Lorg/microemu/android/device/AndroidFont;->paint:Landroid/graphics/Paint;

    invoke-virtual {v4, p1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v4

    sub-float/2addr v3, v4

    float-to-int v1, v3

    goto :goto_1
.end method

.method public fillArc(IIIIII)V
    .locals 6
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "startAngle"
    .parameter "arcAngle"

    .prologue
    .line 146
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 147
    new-instance v1, Landroid/graphics/RectF;

    int-to-float v0, p1

    int-to-float v2, p2

    add-int v3, p1, p3

    int-to-float v3, v3

    add-int v4, p2, p4

    int-to-float v4, v4

    invoke-direct {v1, v0, v2, v3, v4}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 148
    .local v1, rect:Landroid/graphics/RectF;
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v2, p5

    int-to-float v3, p6

    const/4 v4, 0x0

    iget-object v5, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawArc(Landroid/graphics/RectF;FFZLandroid/graphics/Paint;)V

    .line 149
    return-void
.end method

.method public fillRect(IIII)V
    .locals 6
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 152
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 153
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v1, p1

    int-to-float v2, p2

    add-int v3, p1, p3

    int-to-float v3, v3

    add-int v4, p2, p4

    int-to-float v4, v4

    iget-object v5, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    .line 154
    return-void
.end method

.method public fillRoundRect(IIIIII)V
    .locals 1
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "arcWidth"
    .parameter "arcHeight"

    .prologue
    .line 157
    const-string v0, "fillRoundRect"

    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;)V

    .line 158
    return-void
.end method

.method public fillTriangle(IIIIII)V
    .locals 1
    .parameter "x1"
    .parameter "y1"
    .parameter "x2"
    .parameter "y2"
    .parameter "x3"
    .parameter "y3"

    .prologue
    .line 359
    const-string v0, "fillTriangle"

    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;)V

    .line 360
    return-void
.end method

.method public getClipHeight()I
    .locals 2

    .prologue
    .line 161
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->bottom:I

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->top:I

    sub-int/2addr v0, v1

    return v0
.end method

.method public getClipWidth()I
    .locals 2

    .prologue
    .line 165
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->right:I

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->left:I

    sub-int/2addr v0, v1

    return v0
.end method

.method public getClipX()I
    .locals 1

    .prologue
    .line 169
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->left:I

    return v0
.end method

.method public getClipY()I
    .locals 1

    .prologue
    .line 173
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->top:I

    return v0
.end method

.method public getColor()I
    .locals 1

    .prologue
    .line 177
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getColor()I

    move-result v0

    return v0
.end method

.method public getDisplayColor(I)I
    .locals 1
    .parameter "color"

    .prologue
    .line 368
    const-string v0, "getDisplayColor"

    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;)V

    .line 370
    const/4 v0, -0x1

    return v0
.end method

.method public getFont()Ljavax/microedition/lcdui/Font;
    .locals 1

    .prologue
    .line 181
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->font:Ljavax/microedition/lcdui/Font;

    return-object v0
.end method

.method public setClip(IIII)V
    .locals 2
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 185
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->left:I

    if-ne p1, v0, :cond_0

    add-int v0, p1, p3

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->right:I

    if-ne v0, v1, :cond_0

    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->top:I

    if-ne p2, v0, :cond_0

    add-int v0, p2, p4

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->bottom:I

    if-ne v0, v1, :cond_0

    .line 197
    :goto_0
    return-void

    .line 188
    :cond_0
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->left:I

    if-lt p1, v0, :cond_1

    add-int v0, p1, p3

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->right:I

    if-gt v0, v1, :cond_1

    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->top:I

    if-lt p2, v0, :cond_1

    add-int v0, p2, p4

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->bottom:I

    if-le v0, v1, :cond_2

    .line 189
    :cond_1
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    invoke-virtual {v0}, Landroid/graphics/Canvas;->restore()V

    .line 190
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Landroid/graphics/Canvas;->save(I)I

    .line 192
    :cond_2
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iput p1, v0, Landroid/graphics/Rect;->left:I

    .line 193
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iput p2, v0, Landroid/graphics/Rect;->top:I

    .line 194
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    add-int v1, p1, p3

    iput v1, v0, Landroid/graphics/Rect;->right:I

    .line 195
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    add-int v1, p2, p4

    iput v1, v0, Landroid/graphics/Rect;->bottom:I

    .line 196
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    iget-object v1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    invoke-virtual {v0, v1}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/Rect;)Z

    goto :goto_0
.end method

.method public setColor(I)V
    .locals 2
    .parameter "RGB"

    .prologue
    .line 200
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->paint:Landroid/graphics/Paint;

    const/high16 v1, -0x100

    or-int/2addr v1, p1

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V

    .line 201
    return-void
.end method

.method public setFont(Ljavax/microedition/lcdui/Font;)V
    .locals 0
    .parameter "font"

    .prologue
    .line 204
    iput-object p1, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->font:Ljavax/microedition/lcdui/Font;

    .line 205
    return-void
.end method

.method public translate(II)V
    .locals 3
    .parameter "x"
    .parameter "y"

    .prologue
    .line 208
    invoke-super {p0, p1, p2}, Ljavax/microedition/lcdui/Graphics;->translate(II)V

    .line 209
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->canvas:Landroid/graphics/Canvas;

    int-to-float v1, p1

    int-to-float v2, p2

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Canvas;->translate(FF)V

    .line 210
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v0, Landroid/graphics/Rect;->left:I

    sub-int/2addr v1, p1

    iput v1, v0, Landroid/graphics/Rect;->left:I

    .line 211
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v0, Landroid/graphics/Rect;->right:I

    sub-int/2addr v1, p1

    iput v1, v0, Landroid/graphics/Rect;->right:I

    .line 212
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v0, Landroid/graphics/Rect;->top:I

    sub-int/2addr v1, p2

    iput v1, v0, Landroid/graphics/Rect;->top:I

    .line 213
    iget-object v0, p0, Lorg/microemu/android/device/AndroidDisplayGraphics;->clip:Landroid/graphics/Rect;

    iget v1, v0, Landroid/graphics/Rect;->bottom:I

    sub-int/2addr v1, p2

    iput v1, v0, Landroid/graphics/Rect;->bottom:I

    .line 214
    return-void
.end method
